<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="../lib/vue.js"></script>
  </head>

  <body>
    <!--
    -->
    <div id="app">
      <cpn v-show="isshow"></cpn>
    </div>

    <template id="cpn">
      <div>
        <h2>我是组件</h2>
        <p>我是内容，哈哈</p>
        <p v-show="isshow">看不到我了</p>
      </div>
    </template>

    <script>
      var vm = new Vue({
        el: '#app',
        data: {
          message: '你好',
          isshow: true
        },
        methods: {},
        components: {
          cpn: {
            template: '#cpn',
            data() {
              return {
                isshow: false
              }
            }
          }
        }
      })
    </script>
  </body>
</html>
